package com.six.work.servicesImpl;

import com.six.work.entity.Announcement;
import com.six.work.entity.AnnouncementView;
import com.six.work.mapper.AnnouncementMapper;
import com.six.work.services.AnnouncementServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AnnouncementServicesImpl implements AnnouncementServices {
    @Autowired
    private AnnouncementMapper announcementMapper;

    @Override
    public List<AnnouncementView> findAllAnnouncement() {
        List<AnnouncementView> list = announcementMapper.findAllAnnouncement();
        return list;
    }

    @Override
    public Integer DelAnnouncementByID(Integer announcement_id){
        return announcementMapper.DelAnnouncementByID(announcement_id);
    }

    @Override
    public Integer insertAnnouncement(Announcement announcement) {
        return announcementMapper.insertAnnouncement(announcement);
    }

    @Override
    public Announcement SelectAnnouncementByID(Integer announcement_id) {
        return announcementMapper.SelectAnnouncementByID(announcement_id);
    }

    @Override
    public Integer updateAnnouncement(Announcement announcement) {
        return announcementMapper.updateAnnouncement(announcement);
    }

    @Override
    public List<AnnouncementView> findAnnouncementByName(String announcementTitle) {
        return announcementMapper.findAnnouncementByName(announcementTitle);
    }

    @Override
    public List<AnnouncementView> findAnnByadIDAndannName(String announcementTitle, Integer admin_id) {
        return announcementMapper.findAnnByadIDAndannName(announcementTitle,admin_id);
    }

}
